package com.ydm.restaurant.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * 聊天记录表，用于存储用户之间的消息记录
 * @TableName chat
 */
@TableName(value ="chat")
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Chat implements Serializable {
    /**
     * 聊天记录 ID，唯一标识
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 接收者 ID
     */
    private Integer receiverId;

    /**
     * 发送者 ID
     */
    private Integer senderId;

    /**
     * 消息内容
     */
    private String message;

    /**
     * 消息发送时间
     */
    private Date dateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}